import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import '../http/NoLoadingGetApi.dart';

class ProtocolDisplay extends StatefulWidget {
  const ProtocolDisplay({super.key, required this.id});
  final String id;
  @override
  State<ProtocolDisplay> createState() => _ProtocolDisplayState();
}

class _ProtocolDisplayState extends State<ProtocolDisplay> {
  String title ="";
  String content="";
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    getPageAction();
  }
  void getPageAction(){
    NoLoadinggetApiManager.getData(
      context,
      "api/system/dev/article/detail",
      {'category':'BIZ','id':widget.id},
          (responseData)  {
        setState(() {
          title=responseData['data']['title'];
          content=responseData['data']['content'];
        });

      },
    );
  }
  @override
  Widget build(BuildContext context) {
    final screenSize = MediaQuery.of(context).size;
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.white,
        centerTitle: true,
        leading: IconButton(icon: Icon(Icons.arrow_back_ios,color: Colors.black,),onPressed: (){Navigator.pop(context);},),
        title: Text(title,style: TextStyle(color: Colors.black,fontWeight: FontWeight.w300,fontSize: 16.sp),),
      ),
    body: ListView(

      children:[Html(data:content,

      )]
    ),
    );
  }
}
